#ifndef PALETTEQUANTIZER_H
#define PALETTEQUANTIZER_H

#include "quantizer.h"

namespace WingGif {

class PaletteQuantizer : public Quantizer {
  Q_OBJECT
protected:
  QVector<QColor> colors;
  // List of all colors in the palette

public:
  // palette : The color palette to quantize to.
  explicit PaletteQuantizer(QVector<QColor> palette);
  // Construct the palette quantizer.
  // This quantization method only requires a single quantization step when a
  // palette is provided.

  // pixel: The pixel to quantize
  uchar quantizePixel(QColor pixel) override;
  // Override this to process the pixel in the second pass of the algorithm.
  // return : The quantized value

  QVector<QColor> buildPalette() override;
  // Retrieve the palette for the quantized image
  // return : The new color palette
};

} // namespace WingGif

#endif // PALETTEQUANTIZER_H
